<template>
	<view>
		<web-view :src="WebUrl"></web-view>


		<!--<view class="xuanfu_menu">
			<view class="menu_item">
				<view><u-icon name="home" size="38" color="#FFFFFF"></u-icon></view>
				<view class="m_title">首页</view>
			</view>
		</view>-->


	</view>
</template>

<script>
	//var wv;
	export default {
		data() {
			return {
				WebUrl: ''
			}
		},
		onLoad(ops) {
      console.log("ops", ops)
			var webUrl = ops.url
			this.WebUrl = webUrl
		},
		onReady() {
			/*var self = this;
			var currentWebview = this.$scope.$getAppWebview();
			setTimeout(function() {
				let h = 720,
					top = 70;
				wv = currentWebview.children()[0]
				uni.getSystemInfo({ //获取设备信息
					success: function(res) {
						h = res.windowHeight - top;
					}
				});
				wv.setStyle({ //设置web-view高度与web-view跟设备顶部的距离
					top: top,
					height: h,
				})
			}, 1000); //如果是页面初始化调用时，需要延时一下*/
		},
		methods: {
			onNavigationBarButtonTap(e) {
				//console.log('那边的', e)
				//执行直接关闭
				let pages = getCurrentPages()
				let page = pages[pages.length - 1];
				let currentPages = page.$getAppWebview()
				currentPages.close()
				return false
			}
		}
	}
</script>

<style>
	.xuanfu_menu {
		position: absolute;
		top: 60px;
		right: 20px;
		background-color: #000000;
		border-radius: 6px;
		padding: 10px;
		z-index: 99999;
	}

	.menu_item {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.m_title {
		padding-left: 5px;
	}
</style>
